/**
 * FileName: CookieCache
 * Author:   powersi
 * Date:     2021/1/12 9:06
 * Description: cookie
 */
package com.zm.demo.httpclient;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * Description: cookie
 * Author:      powersi
 * Date:        2021/1/12 9:06
 */
public class CookieCache {

    private String cookie;
    private LocalDateTime localDateTime;
    private int timeout;

    public static CookieCache cookieCache;

    public String getCookie() {
        return cookie;
    }

    public void setCookie(String cookie) {
        this.cookie = cookie;
    }

    public LocalDateTime getLocalDateTime() {
        return localDateTime;
    }

    public void setLocalDateTime(LocalDateTime localDateTime) {
        this.localDateTime = localDateTime;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public boolean isExpire(){
        return cookie== null || cookie.isEmpty() || LocalDateTime.now().isAfter(localDateTime.plusSeconds(7000L));
    }
}
